public class Main {
    public static void main(String[] args) {

    }

    public static String func1(String str){
        String s="";
        for(int i=0;i<str.length();i++){
            char ch =str.charAt(i);
            if(!s.contains(ch+"")){
                s+=ch;
            }
        }
        return s;
    }
    public static String func2(String str){
        StringBuilder stringBuilder=new StringBuilder();
        for(int i=0;i<str.length();i++){
            char ch =str.charAt(i);
            if(stringBuilder.indexOf(ch+"")<0){
                stringBuilder.append(ch);
            }
        }
        return stringBuilder.toString();
    }
/*    public String setString(String str) {
        char[] array = str.toCharArray();
        char[] arr = new char[52];
        char[] arrHelp = new char[52];

        for (int i = 0; i < array.length; i++) {
            if ((array[i] >= 'A' && array[i] <= 'Z') && arrHelp[array[i] - 'A'] == 0) {
                arr[i] = array[i];
                arrHelp[array[i] - 'A'] = '1';
            } else if ((array[i] >= 'a' && array[i] <= 'z') && arrHelp[array[i] - 'a' + 26] == 0) {
                arr[i] = array[i];
                arrHelp[array[i] - 'a' + 26] = '1';
            }
        }

        String result = new String(arr);
        return result;
    }*/
    public String setString(String str) {
        char[] array = str.toCharArray();
        char[] arr = new char[52];
        char[] arrHelp = new char[52];

        int index = 0; // 追踪有效字符的索引

        for (int i = 0; i < array.length; i++) {
            if ((array[i] >= 'A' && array[i] <= 'Z') && arrHelp[array[i] - 'A'] == 0) {
                arr[index++] = array[i]; // 使用 index 来赋值有效字符，并递增索引
                arrHelp[array[i] - 'A'] = '1';
            } else if ((array[i] >= 'a' && array[i] <= 'z') && arrHelp[array[i] - 'a' + 26] == 0) {
                arr[index++] = array[i]; // 使用 index 来赋值有效字符，并递增索引
                arrHelp[array[i] - 'a' + 26] = '1';
            }
        }

        String result = new String(arr, 0, index); // 根据有效字符的索引创建新的字符串
        return result;
    }
    public void mergeArrays(int[] A, int m, int[] B, int n) {
        int indexA = m - 1; // A数组的末尾索引
        int indexB = n - 1; // B数组的末尾索引
        int mergeIndex = m + n - 1; // 合并后数组的末尾索引

        // 从后往前遍历，将较大的元素从后往前依次放入合并后的数组中
        while (indexA >= 0 && indexB >= 0) {
            if (A[indexA] >= B[indexB]) {
                A[mergeIndex] = A[indexA];
                indexA--;
            } else {
                A[mergeIndex] = B[indexB];
                indexB--;
            }
            mergeIndex--;
        }

        // 如果B数组还有剩余元素，将其依次放入合并后的数组中
        while (indexB >= 0) {
            A[mergeIndex] = B[indexB];
            indexB--;
            mergeIndex--;
        }
    }
}
 class HasStatic {// 1
    private static int x = 100;// 2

    public static void main(String args[]) {// 3
        HasStatic hsl = new HasStatic();// 4
        hsl.x++;// 5
        HasStatic hs2 = new HasStatic();// 6
        hs2.x++;// 7
        hsl = new HasStatic();// 8
        hsl.x++;// 9
        HasStatic.x--;// 10
        System.out.println(" x=" + x);// 11
    }
}
